#include <stdio.h>
#include <nds.h>

#include "plugin.h"
#include "plugin_def.h"

// derrived from moonshell plugin system, but much simpler
// do not alter this, alter main.cpp instead

u32 pluginUniqueID;
const _plugin_struct *pluginLib;

void LoadLibrary(const _plugin_struct *libFunctions, u32 uID)
{
	pluginLib = libFunctions;
	pluginUniqueID = uID;
	
	// call the plugin constructor function
	DSO_LoadLibrary();
}

void FreeLibrary(void)
{
	// very simple, call the plugin destructor function
	DSO_FreeLibrary();
}

u32 QueryLibrary(long a, long b)
{
	// return the requested interface
	return DSO_QueryInterface(a, b);
}
